<?php

if(file_exists(FilterPath()."/wp-content/themes/shopperpress/themes/".$GLOBALS['shopperpress']['theme'].'/footer.php')){

	include(FilterPath()."/wp-content/themes/shopperpress/themes/".$GLOBALS['shopperpress']['theme'].'/footer.php');

}else{

?>

<?php

/* HIDELAYOUT IS USED IN SOME TEMPLATES */
if( !isset($GLOBALS['HIDELAYOUT']) ){
?>

</div></div><div class="Right <?php echo $GLOBALS['SP_LAY_RIGHT']; ?>">
 
<?php if(!is_single() ){ ?>

<div class="menubox_right_top"> </div>
<div class="menubox_right_mid">

 
	<?php 
	/*
	*	info: Display Search Box
	*/
	
	if($GLOBALS['shopperpress']['search_box'] =="yes3"){ ?>
 	<div class="menubox_box">	
	<h2><span><?php echo SPEC($GLOBALS['_LANG']['_searchwebsite']); ?></span></h2><ul><li>
	<form method="get" id="NewsLetter" action="<?php bloginfo('url'); ?>/">
	<input type="text" value="<?php echo SPEC($GLOBALS['_LANG']['_keyword']) ?>" name="s" id="s" style="width:90%;" onfocus="clearSearch();" />
	<input class="SideBtn" type="image" name="Search" src="<?php bloginfo('template_url'); ?>/themes/<?php echo $GLOBALS['shopperpress']['theme']; ?>/images/SideSearchBtn.gif"/>
	</form>
	</li></ul>
	</div>
	<?php } ?>

	
	 <?php 
	/*
	*	info: Display Account Box
	*/
	
	if($GLOBALS['shopperpress']['account'] =="yes"){ if (get_option('login_form') == "yes" || get_option('login_form') == "") { ?>	
	<div class="menubox_box">	
	<h2><span><?php echo SPEC($GLOBALS['_LANG']['_myaccount']) ?></span></h2>
    
    <ul class="SideProductList">
    	<li>   
    	<center>
		   <?php global $user_ID; if ( $user_ID ) : ?>
			
			<?php global $current_user; get_currentuserinfo();  ?>
			
			<span style="font-size:13px;">
				<?php echo SPEC($GLOBALS['_LANG']['_welcome']) ?> <strong><?php echo $current_user->user_login; ?></strong>
            </span>
            
            <ul class="menubox_box" style="font-size:12px;">
            
            <li><a href="<?php echo get_option("dashboard_url"); ?>"><?php echo SPEC($GLOBALS['_LANG']['_myaccount']) ?></a> </li>
            <?php if(strlen($GLOBALS['shopperpress']['orders_url']) > 5){ ?>
            <li><a href="<?php echo $GLOBALS['shopperpress']['orders_url']; ?>"><?php echo SPEC($GLOBALS['_LANG']['_zz12']) ?></a></li>
            <?php } ?>
            <li><a href="<?php echo wp_logout_url(); ?>"><?php echo SPEC($GLOBALS['_LANG']['_logout']) ?></a></li>
            
            </ul>
             
		   <?php else : ?> 
		   
			   <strong><?php echo SPEC($GLOBALS['_LANG']['_welcomevisitor']) ?></strong>
               
               <br />
               
                <a href="<?php bloginfo('url'); ?>/wp-login.php?action=register">
			   		<?php echo SPEC($GLOBALS['_LANG']['_register']); ?>
                 </a> 
                 
                 <a href="<?php bloginfo('url'); ?>/wp-login.php">
				 	<?php echo SPEC($GLOBALS['_LANG']['_login']); ?>
                 </a>
                 
	
			<?php endif; ?>
            </center>
		</li>
    </ul>
	</div>
	<?php }  } ?>
 

	<?php 
	/*
	*	info: Display Shopping Cart
	*/
	
	if( $GLOBALS['shopperpress']['display_cart'] =="yes"){ 
	
	include("_shoppingcart.php"); 
	
	} ?>
	

	<?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar('Right Sidebar') ) : ?>
    <?php endif; ?>


	<?php 
	/*
	*	info: Featured Items
	*/
	$numItems = get_option("display_fea_num"); if($numItems ==""){ $numItems=5; }
	$show_price 	= get_option("display_pricetag");
	if(get_option("display_featured") =="yes" && get_post_meta($post->ID, "custom_page", true) !="checkout" ){ ?>
    
    
	<div id="ItemProductList">
	<?php $data = shopperPress_featured($numItems);
	$i=1; while($i < 6){  if(isset($data[$i]['link'])){?>
	
	<a href="<?php echo $data[$i]['link']; ?>" rel="bookmark" title="<?php echo $data[$i]['title']; ?>"><img src="<?php echo SPImage($data[$i]['image'],"m"); ?>" alt="<?php echo $data[$i]['title']; ?>" style="max-width:115px;" /></a>
	<p><a href="<?php echo $data[$i]['link']; ?>" title="<?php echo substr($data[$i]['title'],0,15); ?>"><?php echo $data[$i]['title']; ?></a></p>
	<p>

	<?php if($show_price =="yes"){ ?>

		<?php if($data[$i]['old_price'] !="0.00"){ ?>
        	<span class="oldprice">
			<?php echo SPEC($GLOBALS['_LANG']['_was']) ?><strike> <?php echo $_SESSION['currency_symbol'].ShopperPressMoneyFormat($data[$i]['old_price']); ?></strike>
            </span><?php } ?>
		<?php echo $_SESSION['currency_symbol'].ShopperPressMoneyFormat(GetPrice(get_post_meta($data[$i]['id'], "price", true))); ?>

	<?php } ?>	

	</p>			
	<?php } $i++; } ?>	
	</div>
	<?php } ?>

	


	
 

</div>
<div class="menubox_right_bot"> </div>
<br />
<?php 			
	if(isset($GLOBALS['shopperpress']['page_catID']['page_catID']) && is_numeric($GLOBALS['shopperpress']['page_catID'])){ 					
		echo func_advertisingzone($GLOBALS['shopperpress']['page_catID']); 					
	}
?>
<?php echo shopperpress_banner("right"); ?>
<?php } ?>
</div>

<div style="clear:both;"></div>
<?php if ( !function_exists('dynamic_sidebar')    || !dynamic_sidebar('Footer') ) : endif; ?>


<div style="clear:both;"></div>
 <?php }// HIDE LAYOUT ?>



</div>
 
<!-- END SHOPPERPRESS MAIN CONTENT AND MENU BARS -->
<div style="clear:both;"></div>

 
<div class="container_12" id="Footer">
 <p id="copyrightBar">
    Copyright &copy; <?php echo date("Y"); ?> <?php echo get_option('copyright'); ?> 
 </p>
</div>

<div align="right">
<?php if($GLOBALS['shopperpress']['sitemap_url'] != ""){ ?>
    <a style="text-align: right;" href="<?php echo $GLOBALS['shopperpress']['sitemap_url']; ?>">
        Site Map
    </a> 
    <?php } ?>
   
    <?php if($GLOBALS['shopperpress']['tc_url'] !=""){ ?>
    | <a href="<?php echo $GLOBALS['shopperpress']['tc_url']; ?>">  Terms </a>
    <?php } ?>
   
    <?php if($GLOBALS['shopperpress']['parivacy_url'] !=""){ ?>
     |  <a href="<?php echo $GLOBALS['shopperpress']['parivacy_url']; ?>">Privacy Policy</a>  |
    <?php } ?>
 
</div>
  

<div align="center"><?php echo shopperpress_banner("footer"); ?> </div>


<?php echo stripslashes(get_option("analytics_code")); ?>
<?php echo stripslashes(get_option("google_adsensetracking_code")); ?>

<!-- custom field for extra sizes -->
<span id="CustomSize"></span>
<span id="CustomQty"></span>
<span id="CustomColor"></span>
<span id="CustomExtra"></span>
<span id="CustomShipping"><?php if(isset($GLOBALS['default_shipping'])){ echo $GLOBALS['default_shipping']; } ?></span>

<?php javascript_footer() ?>

  <script type="text/javascript">
    function clearSearch() {
      queryBox = document.getElementById('s');
 
      if( queryBox.value == '<?php echo SPEC($GLOBALS['_LANG']['_keyword']) ?>' ) {
        queryBox.value = '';
      }
      queryBox.style.color = '#292929';
    } 
  </script>

<?php wp_footer(); ?>
</body>
</html>
<?php } ?>